#ifndef SERVER_H
#define SERVER_H

#include <stdint.h>
#include <QMap>
#include <QTcpServer>
#include <QTcpSocket>
#include <QJsonDocument>
#include <QDebug>
#include <QCoreApplication>
#include <QDir>
#include <QThread>
#include <QPointer>
#include "constant.h"
#include "chatmessage/Headers/myfileinfo.h"
#include "filethread.h"

class server :public QObject
{
public:
    server();
    void MessagesTcp();
    void GetVidoUdp();
    void SetVidoUdp();
    void start();
private:
    FileThread *fileThread;
    /*Port*/
    qint64 StartTcpPort;
    qint64 MessagesTcpPort;
    qint64 GetVidoTcpPort;
    qint64 SetVidoTcpPort;
    /*Socket*/
    QTcpServer* StartTcpServer;
    QTcpServer* MessagesTcpServer;
    QTcpServer* GetVidoTcpServer;
    QTcpServer* SetVidoTcpServer;
    /*SocketList*/
    QMap<QString,QTcpSocket*>MessagesTcpList;
    QMap<QString,QTcpSocket*>GetVidoTcpList;
    QMap<QString,QTcpSocket*>SetVidoTcpList;
    QMap<QTcpSocket*,QTcpSocket*>sendVido;
    QMap<QString,bool>UserStart;
    bool is_viod;
};

#endif // SERVER_H
